﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="listnews.ascx.cs" Inherits="control_client_listnews" %>
<%@ Register TagPrefix="pager" Namespace="SiteUtils" Assembly="CollectionPager" %>
<div class="blog">
    <asp:DataList ID="list" runat="server" style="margin-right: 575px" Width="100%" 
        DataKeyField="Id" ShowFooter="False" ShowHeader="False">
        <ItemTemplate>
            <div class="leading">
                <h2 class="contentheading">
                    <asp:HyperLink ID="title" runat="server" CssClass="contentpagetitle" 
                        NavigateUrl='<%# "~/detailnews.aspx?key=" + Eval("Id") %>' 
                        Text='<%# Eval("TieuDe") %>'></asp:HyperLink>
	            </h2>
                    <p class="iteminfo">
		                <span class="createdby">	        
		                    Đăng bởi <asp:Label ID="author" runat="server" Text='<%# Eval("TenDangNhap") %>' />
		                    <asp:Label ID="date" runat="server" Text='<%# Eval("NgayDang", "{0:dd/MM/yyyy}") %>' />
		                </span>
	                </p>
                <div class="introtext">
                    <img src='<%# "images/news/content/" + Eval("HinhAnh") %>' alt="" border="0" height="110" width="170">
                    <p>
                        <asp:Label ID="summary" runat="server" Text='<%# Eval("TomTat") %>'></asp:Label>
                        <a class="readon" href='<%# "detailnews.aspx?key=" + Eval("Id") %>'>Chi tiết »</a>
                        <hr />
                    </p>                
                </div>            
	        </div>        
        </ItemTemplate>
    </asp:DataList>
    <center>
        <pager:CollectionPager ID="listpager" runat="server" BackText="« Trước" 
                FirstText="Đầu tiên" LabelText="Trang:" LastText="Cuối cùng" NextText="Sau »" 
                ResultsFormat="Kết quả từ {0}-{1} (của {2}) bài viết" ShowFirstLast="True" 
                SliderSize="5" PagingMode="QueryString" MaxPages="1000" 
                PageNumbersDisplay="Numbers" PageSize="5" QueryStringKey="page" 
                BackNextLinkSeparator="-" ResultsLocation="None" ShowLabel="False" 
                ShowPageNumbers="False">
        </pager:CollectionPager>
    </center>
    <p class="counter">
        Tổng số trang <asp:Label ID="count" runat="server" Text="Label"></asp:Label>
    </p>
</div>
<asp:SqlDataSource ID="dsnews" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    SelectCommand="SELECT * FROM [TinTuc] WHERE TrangThai='True' ORDER BY [Id] DESC, [TrangThai]">
</asp:SqlDataSource>